/*
 * @authors :Bin Mei
 * @date    :2017-08-10
 * @description：票交汇APP-h5 -> 投资模块
 */
import Auth from 'src/utils/requireAuth';
import format from 'src/utils/format';
import column from './column';

module.exports = {
	path: 'helpCenter',
	childRoutes: [
		{
		  path: ':category',
		  getComponent(location, cb) {
				require.ensure([], (require) => {
				  cb(null, require('./Category'));
				});
		  },
			onEnter: (nextState, replace) => {
				let columnItem = column.filter(v=>v.linkName === nextState.params.category);
				let title = columnItem.length&&columnItem[0].name || "帮助中心";
				Auth(nextState, replace,{ title})
			}
		}
	],
	indexRoute: {
		getComponent(location, cb) {
			require.ensure([], (require) => {
				cb(null, require('./Index'));
			});
		},
    onEnter: (nextState, replace) => Auth(nextState, replace,{ title: '帮助中心'}) //,requireAuth:true

	}
}